// 梯控授权
import {
    ajaxPostBack, ajaxPost
} from '@/utils/data/request'

// 梯控授权凭证列表
export function scripList(params: any) {
    return ajaxPostBack("lift-scrip/ladder-scrip-list", params, { cookies: ['yard_sn'] })
}


// 新增住户凭证
export function holderAdd(params: any) {
    return ajaxPost("lift-scrip/scrip-holder-create", params, { successMessage: true, cookies: ['yard_sn'] })
}

// 新增员工凭证
export function staffAdd(params: any) {
    return ajaxPost("lift-scrip/scrip-staff-create", params, { successMessage: true, cookies: ['yard_sn'] })
}


// 删除
export function del({ scrip_sn }: any) {
    return ajaxPost("lift-scrip/scrip-delete", { scrip_sn }, { successMessage: true, cookies: ['yard_sn'] })
}

// 续期
export function renew(params: any) {
    return ajaxPost("lift-scrip/scrip-renew", params, { successMessage: true, cookies: ['yard_sn'] })
}

// 凭证关联的梯控列表
export function scripLadder(params: any) {
    return ajaxPost("lift-scrip/scrip-ladder-port", params, { cookies: ['yard_sn'] })
}
// 凭证未关联的梯控列表
export function scripLadderAddedList(params: any) {
    return ajaxPost("lift-scrip/scrip-port-added-list", params, { cookies: ['yard_sn'] })
}
// 凭证端口设置
export function portSet(params: any) {
    return ajaxPost("lift-scrip/scrip-port-set", params, { successMessage: true, cookies: ['yard_sn'] })
}
// 凭证端口添加
export function portLadderAdd({ scrip_sn, door_sn }: any) {
    return ajaxPost("lift-scrip/scrip-port-add", { scrip_sn, door_sn }, { successMessage: true, cookies: ['yard_sn'] })
}
// 凭证端口删除
export function portLadderDel({ scrip_sn, scrip_port_sn }: any) {
    return ajaxPost("lift-scrip/scrip-port-del", { scrip_sn, scrip_port_sn }, { successMessage: true, cookies: ['yard_sn'] })
}


